package com.rabbitmqproducer.config;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DirectConfig {
	@Bean
	Queue MyDirectQueue1(){
		return new Queue("MyDirectQueue1",true);
	}
	@Bean
	Queue MyDirectQueue2(){
		return new Queue("MyDirectQueue2", true);
	}
	@Bean
	DirectExchange MyDirectExchange(){
		return new DirectExchange("MyDirectExchange",true,false);
	}
	@Bean
	Binding bindingDirect(){
		return BindingBuilder.bind(MyDirectQueue1()).to(MyDirectExchange()).with("MyDirectRouting");
	}
	@Bean
	DirectExchange AloneDirectExchange(){
		return new DirectExchange("AloneDirectExchange");
	}
	@Bean
	Queue ConfirmQueue(){
		return new Queue("ConfirmQueue",true);
	}
	@Bean
	DirectExchange ConfirmExchange(){
		return new DirectExchange("ConfirmExchange",true,false);
	}
	@Bean
	Binding bindingConfirm(){
		return BindingBuilder.bind(ConfirmQueue()).to(ConfirmExchange()).with("ConfirmRouting");
	}
}
